package configurationByXmlTest;

import dao.CustomerDao;
import dao.impl.OrderDaoImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.util.Assert;

/**
 * Created by yuanj on 2018/4/17.
 */
public class XmlTest {

  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("dao.xml");
    OrderDaoImpl dao = context.getBean("orderDao", OrderDaoImpl.class);
    String type = dao.getType();
    System.out.println(type);
    Assert.isTrue(type.equals("COMMONORDER"),"ALL RIGTH");

    CustomerDao cDao=context.getBean("customerDao",CustomerDao.class);
    cDao.print();
  }

}
